R Programming - if else Statement